package com;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class CinemaSystem {
    private List<User> userList = new ArrayList<>();
    private List<Movie> movieList = new ArrayList<>();
    private LogService logService = new LogService();
    public CinemaSystem() {
        User admin = new Admin("A001", "admin", "123456",
                LocalDateTime.of(2025, 1, 1, 0, 0), "13800000000");
        userList.add(admin);
        Movie movie = new Movie("M001", "测试影片", "导演A", "演员B", "简介...", 120, 8.5);
        movieList.add(movie);}
    public void showMenu() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("=== 影院管理系统 ===");
        System.out.print("用户名：");
        String username = scanner.nextLine();
        System.out.print("密码：");
        String password = scanner.nextLine();

        User loginUser = null;
        for (User user : userList) {
            if (user.login(username, password)) {
                loginUser = user;
                break;                          }
                                   }
        if (loginUser != null) {
            System.out.println("登录成功！欢迎 " + loginUser.getUsername());
        } else {
            System.out.println("登录失败，用户名或密码错误");}
                          }
                         }